	#tag Class
	Protected Class Gamepiece
		#tag Method, Flags = &h0
			Function GetPlayer() As Player
			  return player
			End Function
		#tag EndMethod

		#tag Method, Flags = &h0
			Sub Constructor(p as Player)
			  player = p
			  gpColor = p.GetColor
			End Sub
		#tag EndMethod

		#tag Method, Flags = &h0
			Sub SetType(t as integer)
			  if type = Henchman.Undefined then
			    type = t
			  else
			    app.RaiseError(201, "Illegal change of Henchman-type", "Gamepiece.Settype", 3)
			  end if
			End Sub
		#tag EndMethod

		#tag Method, Flags = &h0
			Function GetType() As Integer
			  return type
			  
			End Function
		#tag EndMethod

		#tag Method, Flags = &h0
			Sub Remove()
			  if type <> Henchman.Undefined then
			    type = Henchman.Undefined
			    slot = nil
			    Player.ReturnGamepiece self
			  end if
			End Sub
		#tag EndMethod

		#tag Method, Flags = &h0
			Sub Bind(s as board . Slot)
			  slot = s
			End Sub
		#tag EndMethod

		#tag Method, Flags = &h0
			Function GetColor() As color
			  return gpColor
			End Function
		#tag EndMethod

		#tag Method, Flags = &h0
			Sub setUid(uid as string)
			  self.uid = uid
			End Sub
		#tag EndMethod

		#tag Method, Flags = &h0
			Function GetUid() As String
			  return uid
			End Function
		#tag EndMethod

		#tag Method, Flags = &h0
			Sub Add()
			  player.AddHenchman self
			End Sub
		#tag EndMethod


		#tag Property, Flags = &h21
			Private player As Player
		#tag EndProperty

		#tag Property, Flags = &h21
			Private type As integer = 0
		#tag EndProperty

		#tag Property, Flags = &h21
			Private slot As board.Slot
		#tag EndProperty

		#tag Property, Flags = &h21
			Private gpColor As Color
		#tag EndProperty

		#tag Property, Flags = &h21
			Private uid As string
		#tag EndProperty


		#tag ViewBehavior
			#tag ViewProperty
				Name="Name"
				Visible=true
				Group="ID"
				InheritedFrom="Object"
			#tag EndViewProperty
			#tag ViewProperty
				Name="Index"
				Visible=true
				Group="ID"
				InitialValue="-2147483648"
				InheritedFrom="Object"
			#tag EndViewProperty
			#tag ViewProperty
				Name="Super"
				Visible=true
				Group="ID"
				InheritedFrom="Object"
			#tag EndViewProperty
			#tag ViewProperty
				Name="Left"
				Visible=true
				Group="Position"
				InitialValue="0"
				InheritedFrom="Object"
			#tag EndViewProperty
			#tag ViewProperty
				Name="Top"
				Visible=true
				Group="Position"
				InitialValue="0"
				InheritedFrom="Object"
			#tag EndViewProperty
		#tag EndViewBehavior
	End Class
	#tag EndClass
